/*
 *
 *
 *
 */
#include <iostream>
#include <fstream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <SDL/SDL.h>
#include <string.h>
#include <vector>
#include "Sprite.h"
#include "Animation.h"
#include "Smiley.h"
#include "Audio.h"
#include "TimeCounter.h"

#ifndef _SMILEMANAGER_H_
#define _SMILEMANAGER_H_

#define MAX_NUM_LINE 999
#define MAX_NUM_COLUMN 6
#define BUFFER_SIZE 999
#define WINDOW_WIDTH 640
#define WINDOW_HEIGTH 480

using namespace std;

/*
 * Cada SmileSet corresponde a uma linha do arquivo stage*.txt
 */ 
typedef struct smileSet
{
    int initialTime;
    int finalTime;
    int deltaTime;
    int number;
    float size;
    char file[100];
    double ax;
    double ay;
    double vx;
    double vy;
    int x;
    int y;
    int distance;
}SmileSet;


class SmileManager
{
    private:
        Audio *catchSfx;
        ifstream file;                      /*stream do arquivo stage*.txt*/
        SmileSet *smileSets[MAX_NUM_LINE];  /*array de ponteiros de smileSet, cada linha do arquivo stage*.txt corresponde um elemento smileSet no array*/
        int numSmileSet;                    /*numero de smileSet no array*/
        int numSmiles;                      /*numero total de smiles*/
        vector<Smiley> arraySmiles;
        
    public:
    
        TimeCounter clock;
        SmileManager(string fileName);
        ~SmileManager(void); 
        int update(int tDelta,Sprite *leftHand, Sprite *rightHand);
        void render(SDL_Surface *screen);       
    
};

#endif
